package com.foronenet.tcp;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class TcpClientDemo {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 8899);
        byte[] buffer = "&&\n130711\n1308100.22\n130990.22\n131050\n131120\n131280\n!!".getBytes();

        OutputStream outputStream = socket.getOutputStream();
        outputStream.write(buffer);

//        InputStream inputStream = socket.getInputStream();
//        byte[] bytes = new byte[1024];
//        int len = inputStream.read(bytes);
//        String str = new String(bytes, 0, len);
//        System.out.println(socket.getInetAddress().getHostAddress()+":"+socket.getPort()+"=>"+str);

        socket.close();
    }
}
